<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    class Phone{
        constructor(brand,price) {
            this.brand=brand
            this.price=price
        }
        call(){
            console.log('我可以打电话')
        }
    }
    class SmartPhone extends Phone{
        constructor(brand,price,color,size) {
            // Phone.call(this,brand,price)
            super(brand,price);
            this.color=color
            this.size=size
        }
        photo(){
            console.log('拍照')
        }
        playGame(){
            console.log('玩游戏')
        }
        call() {
            console.log('我可以视频通话')
        }
    }
    const xiaomi=new SmartPhone('小米',799,'黑色','4.7inch')
    console.log(xiaomi)
    console.log(xiaomi.color)
    xiaomi.call()
    xiaomi.photo()
    xiaomi.playGame()
</script>
</body>
</html>
